<template>
		<view class="cu-modal drawer-modal justify-end" :class="modalName=='DrawerModalR'?'show':''" @tap="hideModal">
			<view class="cu-dialog" @tap.stop="" style="width: 90%;">
				<view class="cu-modal-slot">
					<view class="cu-modal-header flex">
						<u-icon  class="cuIcon-searchlist margin-right-sm" size="50" color="#0081ff"></u-icon> 
						筛选
					</view>
					<u-form class="form" :model="query" ref="uForm" label-position="left">
						<!-- <u-form-item class="text-bold" label="是否完成:" prop="cinvcode" label-width="200">
							<js-select v-model="query.cinvcode" dict-type="sys_yes_no" placeholder="请选择是否完成"></js-select>
						</u-form-item> -->
						<u-form-item  label="工装编码:" prop="moldCode" label-width="200">
							<u-input placeholder="请输入" v-model="query.moldCode" type="text" maxlength="200"></u-input>
						</u-form-item>
						<u-form-item  label="工装代码:" prop="caddcode" label-width="200">
							<u-input placeholder="请输入" v-model="query['basMold.caddcode']" type="text" maxlength="200"></u-input>
						</u-form-item>
						<u-form-item  label="工装名称:" prop="moldName" label-width="200">
							<u-input placeholder="请输入" v-model="query['basMold.name']" type="text" maxlength="200"></u-input>
						</u-form-item>
						<u-form-item  label="工装尾号:" prop="lastNum" label-width="200">
							<u-input placeholder="请输入" v-model="query.lastNum" type="text" maxlength="200"></u-input>
						</u-form-item>
						<u-form-item label="工装类型:" prop="basMoldClsCode" label-width="200">
							<u-input placeholder="请输入" v-model="query['basMold.clsCode']" type="text" maxlength="200"></u-input>
						</u-form-item>
						<u-form-item  label="模具保养人:" prop="repairName" label-width="200">
							<u-input placeholder="请输入" v-model="query['empUser.userName']" type="text" maxlength="200"></u-input>
						</u-form-item>
						<u-form-item  label="送保人:" prop="createByName" label-width="200">
							<u-input placeholder="请输入" v-model="query['createByName']" type="text" maxlength="200"></u-input>
						</u-form-item>
						
						<u-form-item label="状态:" prop="状态" label-width="200">
							<js-select v-model="query.status" dict-type="bpm_biz_status"></js-select>
						</u-form-item>
					</u-form>
					
					<view class="cu-modal-footer flex">
						<!-- round -->
						<button class="cu-btn  lines-red lg " @click="hideModal">重置</button>
						<button class="cu-btn  bg-confirm lg margin-left " @click="confirmDialog">确定</button>

					</view>
				</view>
			</view>
		</view>
</template>
<script>
export default {
    name: 'customDialog',
    props: {
        modalName:{
            type: String,
            default: null
        },
    },
    data() {
        return{
          type: 'text',
				  border: true,
          query:{
            pageNo: 1,
            pageSize: 20,
           }
        }
    },
    created() {
		
    },
    methods: {
		DateChange(item, e) {
		  console.log(item, e);
		  //   this.date = e.detail.value;
		  if (item === "repairDate") {
		    this.query.repairDate = e.detail.value;
		  } else if(item === "ddate"){
			  this.query.ddate = e.detail.value;
		  }
		  this.$forceUpdate();
		},
		hideModal() {
			this.query = {
				pageNo: 1,
				pageSize: 20,
				status:''
			}
			this.$emit('getModalName',{
			  modalName: null,
			  query: this.query
			})
			// 显示tabbar
			uni.showTabBar();
		},
		confirmDialog(){
				if(this.query.status === undefined){
					this.query.status = ''
				}
				// 把query值传递给父组件，关闭弹窗
				this.$emit('getModalName',{
					modalName: null,
					// 显示tabbar
					query: this.query
				});
				// 显示tabbar
				uni.showTabBar();
		},
    }
}
</script>
<style scoped lang="scss">
.cu-modal-slot {
  margin: 42rpx 32rpx 20rpx 32rpx;
  height: 100vh;
  position: relative;
}
.cu-modal-header {
  font-size: 38rpx;
  color: #3d3d3d;
  line-height: 40rpx;
  text-align: left;
  font-weight: 500;
}
.button {
  font-size: 32rpx;
  color: #666666;
  line-height: 40rpx;
  padding: 12rpx 40rpx;
  margin-bottom: 20rpx;
  background: #f7f7f7;
  border-radius: 180rpx;
}
.button:hover {
  background: #3e97b0;
  color: #ffffff;
}
.cu-modal-search-title {
  margin: 32rpx 0rpx 20rpx 0rpx;
  text-align: left;
  font-size: 32rpx;
  color: #999999;
  line-height: 40rpx;
}
.cu-dialog {
  background: #ffffff;
}
.cu-modal-footer {
  position: absolute;
  bottom: 80rpx;
  width: 100%;
  .cu-btn {
    width: 50%;
  }
}
.bg-confirm {
  background: #3e97b0;
  color: #ffffff;
}
.cuIcon-searchlist{
	color:#0081ff;
	font-size: 80rpx;
}
</style>
